/*
package com.lzm.one.utils;

*/
/**
 * @Author LiZhiMin
 * @Date 2025/1/11 12:23
 *//*


import com.google.api.client.googleapis.auth.oauth2.GoogleCredential;
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.services.webmasters.Webmasters;
import com.google.api.services.webmasters.WebmastersScopes;

import java.io.FileInputStream;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.util.Collections;

public class SitemapSubmitter {

    private static final String APPLICATION_NAME = "Your Application Name";
    private static final JsonFactory JSON_FACTORY = JacksonFactory.getDefaultInstance();
    private static final String CREDENTIALS_FILE_PATH = "https://gemini-ming.github.io/sitemap.xml";
    private static final String SITE_URL = "https://gemini-ming.github.io/";
    private static final String SITEMAP_URL = "https://gemini-ming.github.io/sitemap.xml";

    public static void main(String[] args) {
        try {
            // 加载凭据
            GoogleCredential credential = GoogleCredential.fromStream(new FileInputStream(CREDENTIALS_FILE_PATH))
                    .createScoped(Collections.singleton(WebmastersScopes.WEBMASTERS_READONLY));

            // 构建 Webmasters 服务对象
            Webmasters webmasters = new Webmasters.Builder(
                    GoogleNetHttpTransport.newTrustedTransport(),
                    JSON_FACTORY,
                    credential)
                    .setApplicationName(APPLICATION_NAME)
                    .build();

            // 提交站点地图
            webmasters.sitemaps().submit(SITE_URL, SITEMAP_URL).execute();
            System.out.println("站点地图提交成功！");
        } catch (GeneralSecurityException | IOException e) {
            System.err.println("发生错误: " + e.getMessage());
            e.printStackTrace();
        }
    }
}*/
